home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 14230 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.9 KB  |  70 lines

  1. Newsgroups: comp.object,comp.lang.eiffel,comp.lang.c++,comp.lang.beta,comp.lang.java,comp.lang.sather
  2. Path: newsfeed.acns.nwu.edu!ftpbox!mothost!schbbs!news
  3. From: shang@corp.mot.com (David L. Shang)
  4. Subject: Re: What Should An Exception Handling Do? -- Clarification of rules
  5. Reply-To: shang@corp.mot.com
  6. Organization: MOTOROLA 
  7. Date: Fri, 29 Mar 1996 15:23:21 GMT
  8. Message-ID: <1996Mar29.152321.25943@schbbs.mot.com>
  9. References: <4jefbd$k33@kai.com>
  10. Sender: news@schbbs.mot.com (SCHBBS News Account)
  11. Nntp-Posting-Host: 129.188.128.126
  12.  
  13. In article <4jefbd$k33@kai.com> robison@kai.com (Arch Robison) writes:
  14. > In article <1996Mar27.211117.5569@schbbs.mot.com> shang@corp.mot.com writes:
  15. > >If resumption semantics were inferior, why should we bother to get
  16. > >its "benefits" by simulating its semantics as below:
  17. > I should have qualified my statement "inferior" to "inferior in most cases".
  18. >
  19.  
  20. When you say inferior, please be specific, otherwise you cannot
  21. convince people.
  22.  
  23. > >What happen if we forget to inialize "retry"? Okay, we can use break, but
  24. > >what happen if we have nested exceptions? "Goto" must be used, I guess.
  25. > >Busy jumps around are no fun.
  26. > >
  27. > >What happen if we forget to set "result" to NULL under condition4?
  28. > What if I forget to increment my loop variables?  What if I use single 
  29. > precision where I should have used double precision?  What if I misunderstood 
  30. > the problem specification?  What if my disk drive explodes today?
  31.  
  32. A language cannot guarantee that every body using it do not
  33. say someting wrong. But a good programming language should
  34. help programmers make less errors.
  35.  
  36. Basic principles exsist. For example, a function that has
  37. an output should guarantee that the code writer returns
  38. an value in the correct type. The questions I asked belongs to
  39. basic principles. Your disk drive explosion has nothing do to with
  40. the principle of language design. 
  41.  
  42. > There is no such thing as a feature
  43. > that "you do not pay for it if you do not use it."
  44.  
  45. If language makes you to have the above conclusion, the design of the
  46. language is questionale. Futunately, C++ is not the language. And in
  47. contrast,  "you do not pay for it if you do not use it" is the
  48. design principle of C++.
  49.  
  50. > Thus many apparently useful features are deliberately left out of C++.
  51. > Users who want the features can simulate them without burdening others.
  52. > Besides, for some of these features, even the users who want them
  53. > disagree about the precise semantics, so it is often better to let
  54. > the users simulate the feature so that they can define the semantics
  55. > they want.
  56.  
  57. So why should we have inheritance? virtual functions? We can use
  58. C function pointers to simulate them! Simlation is always possible, even
  59. with machine languages.
  60.  
  61. Finally, my original post is a question, to ask what should an
  62. exception handling do. No one is attacking C++. People can always
  63. express their different opinions. Please do not overact. We are
  64. not talking a particular language here.
  65.  
  66. David Shang
  67.  
  68.